<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/7/26 0026
 * Time: 下午 2:20
 */

namespace app\home\controller;


use think\Db;

class Ganbu extends HomeBase
{
    public function getlist(){
        $current=input('current');
        if(!$current){
            $current=1;
        }
        $pagenums=input('pagenums');
        if(!$pagenums){
            $pagenums=50;
        }
        $nowpagenums=($current-1)*$pagenums;
        $order=input('order');
        if(!$order){
            $order='hb_zijincat.id DESC';
        }
        $info=Db::name('Ganbuinfo')->where('guanxi','=','本人')->field('id,name,zhiwu,zhen,cun,sex,zzmianmao')->select();
        if($info){
            foreach ($info as $key=>$value){
                $info[$key]['zhen']=$value['cun'];
                $info[$key]['qinqinums']=Db::name('Ganbuinfo')->where('zhen','=',$zhen)->where('cun','=',$cun)->where('guanxi','<>','本人')->where('gxname',$value['name'])->count('id');
            }
        }
    }
}